<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 喜欢 -->
    <Like />
    <!-- 楼层 -->
    <!-- floor没数据就不会展示 有数据才展示-->
    <Floor v-for="floor in floors" :key="floor.id" :floor="floor"/>
    <!-- 商标 -->
    <Brand />
  </div>
</template>

<script>
import ListContainer from "./ListContainer";
import Recommend from "./Recommend";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";

import { reqGetFloors } from "@/api/home";

export default {
  name: "XHome",
  components: { ListContainer, Recommend, Rank, Like, Floor, Brand },
  data() {
    return {
      floors: [], // 两个楼层信息
    };
  },
  async mounted() {
    const data = await reqGetFloors();
    this.floors = data;
    // console.log(this.floors);
  },
};
</script>
